]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telephatyIdle: Time stamps next conversation line
authorCarlos Soriano <carlos.soriano89@gmail.com>
Fri, 13 Sep 2013 12:55:07 +0000 (14:55 +0200)
committerCarlos Soriano <carlos.soriano89@gmail.com>
Mon, 17 Feb 2014 19:00:00 +0000 (20:00 +0100)
To give more context to the chat notification bubble, put the
time stamp next to the last conversation line instead of
a new line.

https://bugzilla.gnome.org/show_bug.cgi?id=708031

data/theme/gnome-shell.css
js/ui/components/telepathyClient.js

index d74beb3d133702230724fc958bc2ec8c3053a863..61a6284dd174ec0804efce880601e50d7b46cdca 100644 (file)
@@ -1648,8 +1648,8 @@ StScrollBar StButton#vhandle:active {
     color: #888888;
 }
 
-.chat-group-sent, .chat-group-meta {
-    padding: 8px 0;
+.chat-empty-line {
+    font-size: 4px;
 }
 
 .chat-received {
@@ -1674,6 +1674,7 @@ StScrollBar StButton#vhandle:active {
 .chat-meta-message {
     padding-left: 4px;
     font-size: 9pt;
+    font-weight: bold;
     color: #bbbbbb;
 }
 
index 144d369b2674f6d77cbd89f1647e0b0a9ad2f64c..a78fbafd56690da4525a18e9d7e1b0db78ec39e2 100644 (file)
@@ -1,5 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Lang = imports.lang;
@@ -905,14 +906,14 @@ const ChatNotification = new Lang.Class({
 
         let group = props.group;
         if (group != this._lastGroup) {
-            let style = 'chat-group-' + group;
             this._lastGroup = group;
-            this._lastGroupActor = new St.BoxLayout({ style_class: style,
-                                                      vertical: true });
-            this.addActor(this._lastGroupActor);
+            let emptyLine = new St.Label({ style_class: 'chat-empty-line' });
+            this.addActor(emptyLine);
         }
 
-        this._lastGroupActor.add(body, props.childProps);
+        this._lastMessageBox = new St.BoxLayout({ vertical: false });
+        this._lastMessageBox.add(body, props.childProps);
+        this.addActor(this._lastMessageBox);
 
         this.updated();
 
@@ -943,28 +944,28 @@ const ChatNotification = new Lang.Class({
 
         // Show only the hour if date is on today
         if(daysAgo < 1){
-            format = "<b>%H:%M</b>";
+            format = _("%H:%M");
         }
         // Show the word "Yesterday" and time if date is on yesterday
         else if(daysAgo <2){
             /* Translators: this is the word "Yesterday" followed by a time string. i.e. "Yesterday, 14:30"*/
             // xgettext:no-c-format
-            format = _("<b>Yesterday</b>, <b>%H:%M</b>");
+            format = _("Yesterday, %H:%M");
         }
         // Show a week day and time if date is in the last week
         else if (daysAgo < 7) {
             /* Translators: this is the week day name followed by a time string. i.e. "Monday, 14:30*/
             // xgettext:no-c-format
-            format = _("<b>%A</b>, <b>%H:%M</b>");
+            format = _("%A, %H:%M");
 
         } else if (date.getYear() == now.getYear()) {
             /* Translators: this is the month name and day number followed by a time string. i.e. "May 25, 14:30"*/
             // xgettext:no-c-format
-            format = _("<b>%B</b> <b>%d</b>, <b>%H:%M</b>");
+            format = _("%B %d, %H:%M");
         } else {
             /* Translators: this is the month name, day number, year number followed by a time string. i.e. "May 25 2012, 14:30"*/
             // xgettext:no-c-format
-            format = _("<b>%B</b> <b>%d</b> <b>%Y</b>, <b>%H:%M</b> ");
+            format = _("%B %d %Y, %H:%M");
         }
 
         return date.toLocaleFormat(format);
@@ -976,13 +977,14 @@ const ChatNotification = new Lang.Class({
         let lastMessageTime = this._history[0].time;
         let lastMessageDate = new Date(lastMessageTime * 1000);
 
-        let timeLabel = this._append({ body: this._formatTimestamp(lastMessageDate),
-                                       group: 'meta',
-                                       styles: ['chat-meta-message'],
-                                       childProps: { expand: true, x_fill: false,
-                                                     x_align: St.Align.END },
-                                       noTimestamp: true,
-                                       timestamp: lastMessageTime });
+        let timeLabel = new St.Label({ text: this._formatTimestamp(lastMessageDate),
+                                       style_class: 'chat-meta-message',
+                                       x_expand: true,
+                                       y_expand: true,
+                                       x_align: Clutter.ActorAlign.END,
+                                       y_align: Clutter.ActorAlign.END });
+
+        this._lastMessageBox.add_actor(timeLabel);
 
         this._filterMessages();